package com.zhou.imserver;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * Created by zhou on 2016/3/12.
 */
public class ServerReader extends Thread {
    public InputStream mInputStream;

    public ServerReader(InputStream inputStream) {
        this.mInputStream = inputStream;
    }

    @Override
    public void run() {
        super.run();
        BufferedReader bufferedReader = null;
        bufferedReader = new BufferedReader(new InputStreamReader(mInputStream));
        while (true) {
            String str = null;
            try {
                str = bufferedReader.readLine();
                System.out.println("---->" + str);
                if(str==null){
                    break;
                }
            } catch (IOException e) {
//                e.printStackTrace();
                System.out.println("this Thread has Some Problem Reader");
                break;
            }

        }

    }
}
